package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.List;

@Data
@NoArgsConstructor
@TableName("t_saleorder")
public class SaleOrderBean {
    @TableId(value = "pk_saleOrderId",type = IdType.AUTO)
    private Integer id;
    @TableField("fk_clientId")
    private Integer clientId;
    @TableField(exist = false)
    private ClientBean client;
    @TableField("fk_userId")
    private Integer userId;

    @TableField(exist = false)
    private UserBean user;
    @TableField("so_createDate")
    private LocalDate createDate=LocalDate.now();
    @TableField("so_totalPrice")
    private Integer totalPrice;
    @TableField("so_address")
    private String address;

    @TableField(exist = false)
    private List<SaleOrderInfoBean> saleOrderInfoList;

    public SaleOrderBean(Integer clientId, Integer userId, Integer totalPrice, String address) {
        this.clientId = clientId;
        this.userId = userId;
        this.totalPrice = totalPrice;
        this.address = address;
    }
}
